const { DataTypes } = require("sequelize");
const seq = require("../db/seq.js");

const Details = seq.define(
  "details",
  {
    detailId: {
      type: DataTypes.INTEGER,
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      comment: "详情ID",
    },
    tag:{
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "标签名称，不同的表对应不同的标签",
    },
    tagId: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: "标志ID",
    },
    detailKey: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "详情键名",
    },
    detailValue: {
      type: DataTypes.TEXT,
      allowNull: false,
      defaultValue: "",
      comment: "详情内容",
    },
    detailType: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: "",
      comment: "详情类型",
    },
    dataFlag: {
      type: DataTypes.TINYINT,
      allowNull: false,
      defaultValue: 1,
      comment: "删除标志",
    }
  },
  {
    freezeTableName: true,
    timestamps: false,
  }
);
module.exports = Details;